﻿namespace Morus.Infrastructure
{
    using System;

    public interface IMessageDispatcher
    {
        void DispatchMessage<TMessage>(TMessage message);
        void Register<T>(IHandler<T> handler);
        void Clear();

        event EventHandler<MessageDispatchEventArgs> Dispatching;
        event EventHandler<MessageDispatchEventArgs> Dispatched;
        event EventHandler<MessageDispatchEventArgs> DispatchFailed;
    }
}
